<template>
  <div class="po-re" style="height: 496px">
    <img src="~@/assets/img/cg/cg-b1.jpg" alt="" class="ad-img" />
    <div
      style="width: 100%; height: 180px; position: absolute; bottom: -90px"
      class="flex flex-j-c"
    >
      <img
        src="~@/assets/img/cg/cg.png"
        style="width: 932px; height: 180px"
        alt=""
        class="ad-img"
      />
    </div>
  </div>
  <div class="main mainPadding p-b" style="background: #fff">
    <div class="max-w">
      <el-breadcrumb separator=">" style="padding-top: 98px">
        <el-breadcrumb-item
          class="cursor-p"
          v-for="(item, i) in breadcrumb_list"
          :key="i"
          @click="Router.go(-1)"
          >{{ item.name }}</el-breadcrumb-item
        >
      </el-breadcrumb>
      <div class="ad-view MarT">
        <adImgView />
      </div>
      <div
        class="MarT shadow-3 border-r6"
        style="
          height: 542px;
          background: linear-gradient(to bottom, #fffaf7, #ffe3cf);
          padding: 45px;
        "
      >
        <el-row :gutter="0" class="withFull">
          <el-col :span="12">
            <div
              class="font-title"
              style="text-align: left; line-height: 28px"
            >
            {{ info?info.title:'' }}
            
          </div>
          <div v-html="info?info.blurb:''"></div>
          </el-col>
          <el-col :span="12" style="padding-left: 55px">
            <div style="height: 58px" class="flex flex-j-c">
              <imgView :src="info?info.logo:''" />
            </div>
            <div class="ad-view" style="height: 359px; margin-top: 25px">
              <imgView :src="info?info.cover:''" />
            </div>
          </el-col>
        </el-row>
      </div>
      <div class="MarT shadow-3 border-r6" style="padding: 40px 24px">
        <TitleView title="实践成果"></TitleView>
        <myEmpty v-if="sjcg_list.length == 0" />
        <div
          v-for="(item, i) in sjcg_list"
          :key="i"
          style="margin-top: 33px"
          class="cursor-p"
          @click="proxy.$comJs.openInfo('企业成果库', '实践成果', item)"
        >
          <el-row gutter="0" class="withFull">
            <el-col :span="8">
              <div
                class="omit"
                style="color: #d10b00; font-size: 16px; text-align: left"
              >
                {{ item.name }}
              </div>
            </el-col>
            <el-col :span="16" style="padding-left: 20px">
              <div style="font-size: 16px; text-align: left">
                主创：{{ item.user }} 参创：{{ item.joinUser }}
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="MarT shadow-3 border-r6" style="padding: 40px 24px">
        <TitleView title="理论实践"></TitleView>
        <myEmpty v-if="llsj_list.length == 0" />
        <div
          v-for="(item, i) in llsj_list"
          :key="i"
          style="margin-top: 33px"
          class="cursor-p"
          @click="proxy.$comJs.openInfo('企业成果库', '理论实践', item)"
        >
          <el-row gutter="0" class="withFull">
            <el-col :span="8">
              <div
                class="omit"
                style="color: #d10b00; font-size: 16px; text-align: left"
              >
                {{ item.name }}
              </div>
            </el-col>
            <el-col :span="16" style="padding-left: 20px">
              <div style="font-size: 16px; text-align: left">
                主创：{{ item.user }} 参创：{{ item.joinUser }}
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="MarT shadow-3 border-r6" style="padding: 40px 24px">
        <TitleView title="创新人物"></TitleView>
        <div class="flex MarT35">
          <myEmpty v-if="cxrw_list.length == 0" />
          <div
            class="cxview"
            v-for="(item, i) in cxrw_list"
            :key="i"
            @click="proxy.$comJs.openInfo('企业成果库', '创新人物', item)"
          >
            <div class="ad-view" style="height: 280px">
              <imgView :src="item.thumb" />
            </div>
            <div style="margin-top: 22px">
              <div class="cview">
                <span class="t1">姓名：</span
                ><span class="t2">{{ item.title }}</span>
              </div>
              <div class="cview">
                <span class="t1">职务：</span
                ><span class="t2">{{ item.post }}</span>
              </div>
              <!-- <div class="cview">
                <span class="t3">创新贡献：</span>
                <img
                  v-for="items in item.gx"
                  :key="items"
                  src="@/assets/img/cg/pj.png"
                  alt=""
                  style="width: 20px; height: 20px; margin-left: 7px"
                />
              </div> -->
            </div>
          </div>
        </div>
      </div>
      <div class="MarT">
        <el-row gutter="0" class="withFull">
          <el-col :span="16">
            <Card1 title="名品汇" :more="true" @moreClick="proxy.$comJs.openMoreList('企业成果库','名品汇',titleList[2].id)" class="shadow-1">
              <template v-slot:main>
                <div
                  class="MarB"
                  style="height: 420px"
                  @click="click_mph(mph_list.length > 0 ? mph_list[0] : '')"
                >
                  <imgView
                    :src="mph_list.length > 0 ? mph_list[0].thumb : ''"
                  />
                </div>
                <div style="width: 100%">
                  <el-row gutter="0" class="withFull">
                    <el-col :span="10">
                      <div style="padding-right: 10px">
                        <div
                          class="MarB"
                          style="height: 162px"
                          @click="
                            click_mph(mph_list.length > 1 ? mph_list[1] : '')
                          "
                        >
                          <imgView
                            :src="mph_list.length > 1 ? mph_list[1].thumb : ''"
                          />
                        </div>
                        <div
                          style="height: 162px"
                          @click="
                            click_mph(mph_list.length > 4 ? mph_list[4] : '')
                          "
                        >
                          <imgView
                            :src="mph_list.length > 4 ? mph_list[4].thumb : ''"
                          />
                        </div>
                      </div>
                    </el-col>
                    <el-col :span="7">
                      <div
                        style="height: 344px; padding: 0 10px"
                        @click="
                          click_mph(mph_list.length > 2 ? mph_list[2] : '')
                        "
                      >
                        <imgView
                          :src="mph_list.length > 2 ? mph_list[2].thumb : ''"
                        />
                      </div>
                    </el-col>
                    <el-col :span="7">
                      <div style="padding-left: 10px">
                        <div
                          class="MarB"
                          style="height: 162px"
                          @click="
                            click_mph(mph_list.length > 3 ? mph_list[3] : '')
                          "
                        >
                          <imgView
                            :src="mph_list.length > 3 ? mph_list[3].thumb : ''"
                          />
                        </div>
                        <div
                          style="height: 162px"
                          @click="
                            click_mph(mph_list.length > 5 ? mph_list[5] : '')
                          "
                        >
                          <imgView
                            :src="mph_list.length > 5 ? mph_list[5].thumb : ''"
                          />
                        </div>
                      </div>
                    </el-col>
                  </el-row>
                </div>
              </template>
            </Card1>
          </el-col>
          <el-col :span="8" style="padding-left: 20px">
            <Card1
              title="创新报道"
              :more="true"
              @moreClick="
                proxy.$comJs.openMoreList(
                  '企业成果库',
                  '创新报道',
                  titleList[3].id
                )
              "
              class="shadow-1"
            >
              <template v-slot:main>
                <div style="height: 320px">
                  <myEmpty v-if="cxbd_list.length == 0" />
                  <div class="p-t">
                    <div
                      class="f-desc-14 omit MarB"
                      style="color: #333"
                      v-for="(item, i) in cxbd_list"
                      :key="i"
                      @click="
                        proxy.$comJs.openInfo('企业成果库', '创新报道', item)
                      "
                    >
                      {{ item.name }}
                    </div>
                  </div>
                </div>
              </template>
            </Card1>
            <Card1
              title="专利资质"
              :more="true"
              @moreClick="
                proxy.$comJs.openMoreList(
                  '企业成果库',
                  '专利资质',
                  titleList[5].id
                )
              "
              class="MarT shadow-1"
            >
              <template v-slot:main>
                <div style="padding-top: 6px; height: 365px">
                  <myEmpty v-if="zlzz_list.length == 0" />
                  <el-row gutter="20">
                    <el-col
                      :span="12"
                      v-for="(item, i) in zlzz_list"
                      :key="i"
                      @click="
                        proxy.$comJs.openInfo('企业成果库', '专利资质', item)
                      "
                    >
                      <div
                        class="ad-view"
                        style="height: 160px; margin-bottom: 20px"
                      >
                        <imgView :src="item.thumb" />
                      </div>
                    </el-col>
                  </el-row>
                </div>
              </template>
            </Card1>
          </el-col>
        </el-row>
      </div>
      <div class="MarT shadow-3 border-r6" style="padding: 40px 24px">
        <TitleView title="荣誉墙"></TitleView>
        <div class="MarT35 flex widthFull">
          <myEmpty v-if="ryq_list.length == 0" />
          <div
            style="width: 20%; padding: 0 10px"
            v-for="(item, i) in ryq_list"
            :key="i"
          >
            <div
              class="ad-view"
              style="width: 100%; height: 280px"
              @click="proxy.$comJs.openInfo('企业成果库', '荣誉墙', item)"
            >
              <imgView :src="item.thumb" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, onMounted, getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
import CryptoJS from "crypto-js";
import TitleView from "../../components/title.vue";
import Card1 from "../../components/card1.vue";
import { useRouter } from "vue-router";
const Router = useRouter();
// 面包屑
const breadcrumb_list = [{ name: "成果库" }, { name: "企业成果库" }];
// // 路由参数
const titleList = Router.currentRoute.value.query.ob?proxy.$comJs.decrypt(
  Router.currentRoute.value.query.ob
).nav.children:[];
const eid = proxy.$comJs.decrypt(
  Router.currentRoute.value.query.ob
).eid;
// 详情
const info = ref(null)
const getInfo=()=>{
  proxy.$http.request(proxy.$api.enterprise+'/'+proxy.$comJs.decrypt(
  Router.currentRoute.value.query.ob
).eid,'get',{},false, function (res) {
      if(res&&res.data){
          info.value = res.data.data
      }
  })
}
getInfo()
// 实践成果
const sjcg_list = ref([]);
const llsj_list = ref([]);
const cxrw_list = ref([]);
// 名品汇
const mph_list = ref([]);
// 创新报道
const cxbd_list = ref([]);
// 专利资质
const zlzz_list = ref([]);
const ryq_list = ref([]);
const getList = () => {
  titleList.map((item, i) => {
    // 实践成果
    if (i == 0) {
      proxy.$comJs.getEnterpriseNews(
        eid,
        item.id,
        (data) => {
          sjcg_list.value = data.list;
        }
      );
    }
    // 理论实践
    if (i == 1) {
      proxy.$comJs.getEnterpriseNews(
        eid,
        item.id,
        (data) => {
          llsj_list.value = data.list;
        }
      );
    }
    // 名品汇
    if (i == 2) {
      proxy.$comJs.getEnterpriseNews(
        eid,
        item.id,
        (data) => {
          mph_list.value = data.list;
        }
      );
    }
    // 创新报道
    if (i == 3) {
      proxy.$comJs.getEnterpriseNews(
        eid,
        item.id,
        (data) => {
          cxbd_list.value = data.list;
        }
      );
    }
    // 荣誉墙
    if (i == 4) {
      proxy.$comJs.getEnterpriseNews(
        eid,
        item.id,
        (data) => {
          ryq_list.value = data.list;
        }
      );
    }
    // 专利资
    if (i == 5) {
      proxy.$comJs.getEnterpriseNews(
        eid,
        item.id,
        (data) => {
          zlzz_list.value = data.list;
        }
      );
    }
    // 创新人物
    if (i == 6) {
      
      proxy.$http.request(proxy.$api.enterprisePerson+eid,'get',{},false, function (res) {
        if(res&&res.data){
            if(res.data.data.list!= undefined){
              cxrw_list.value = res.data.data.list
            } 
        }
      })
      // proxy.$comJs.getEnterpriseNews(
      //   5,
      //   item.id,
      //   { nextTag: 0, prevTag: 0 },
      //   "",
      //   (data) => {
      //     cxrw_list.value = data.list;
      //   }
      // );
    }
    

  });
};
getList();
const click_mph = (item) => {
  if (!item) {
    return;
  }
  proxy.$comJs.openInfo("企业成果库", "名品汇", item);
};
</script>

<style lang='less' scoped>
.cxview {
  width: 20%;
  padding: 0 10px;
  .cview {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    .t1 {
      color: #8d8d8d;
      font-size: 15px;
      text-align: left;
      margin-right: 40px;
      font-weight: bold;
    }
    .t2 {
      font-size: 15px;
      text-align: left;
      font-weight: bold;
    }
    .t3 {
      color: #8d8d8d;
      font-size: 15px;
      text-align: left;
      font-weight: bold;
    }
  }
}
.mphView {
}
</style>
